<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="供应商" prop="supplierName">
        <el-input
          v-model="queryParams.supplierName"
          placeholder="请输入供应商"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品编号" prop="shareGoodsId">
        <el-select v-model="queryParams.shareGoodsId" filterable clearable remote :remote-method="getShareGoodsOptions" size="small">
          <el-option v-for="good in shareGoodsOptions"
                     :key="good.goodsId"
                     :label="good.goodsName"
                     :value="good.goodsId" />
        </el-select>
      </el-form-item>
      <el-form-item label="报价" prop="price">
        <el-input
          v-model="queryParams.price"
          placeholder="请输入报价"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="串号" prop="goodsSn">
        <el-input
          v-model="queryParams.goodsSn"
          placeholder="请输入串号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="创建时间">
        <el-date-picker
          size="small"
          v-model="createTimeRange"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :unlink-panels="true"
          @change="createTimeChange"
        ></el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['recovery:scattered:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['recovery:scattered:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['recovery:scattered:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['recovery:scattered:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table border v-loading="loading" :data="scatteredList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="验机编号" align="center" prop="scatteredId" />
      <el-table-column label="供应商" align="center" prop="supplierName" width="120" />
      <el-table-column label="手机号" align="center" prop="mobile" width="180" />
      <el-table-column label="型号" align="center" prop="goodsName" width="180" show-overflow-tooltip />
      <el-table-column label="规格" align="center" prop="printing" width="180" show-overflow-tooltip />
      <el-table-column label="IMEI" align="center" prop="goodsSn" width="180" show-overflow-tooltip />
      <el-table-column label="验机报告" align="center" prop="testValues" :formatter="testValuesFormatter" :show-overflow-tooltip="true" width="200" />
      <el-table-column label="成色" align="center" prop="fineness" width="120" />
      <el-table-column label="报价" align="center" prop="price" width="130">
        <template v-slot="scope">
          {{scope.row.price}}元
        </template>
      </el-table-column>
      <el-table-column label="创建人" align="center" prop="createId" :formatter="userFormatter" width="180" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="210" />
      <el-table-column label="是否回收" align="center" prop="status">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status === 1">是</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" width="200" />
<!--      <el-table-column label="打款" align="center">
        <template v-slot="scope">
          <el-tag size="mini" v-if="scope.row.hasPay === 1" type="info">已打款</el-tag>
        </template>
      </el-table-column>-->
      <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            v-if="scope.row.status !== 1"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['recovery:scattered:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-document-delete"
            @click="handleBlack(scope.row)"
          >黑名单</el-button>
          <el-button
            v-if="scope.row.status !== 1"
            size="mini"
            type="text"
            icon="el-icon-takeaway-box"
            @click="handleCollect(scope.row)"
            v-hasPermi="['recovery:scattered:collect']"
          >回收</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['recovery:scattered:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog title="黑名单" :visible.sync="black.open" width="80%" append-to-body>
      <el-form>
        <el-row>
          <el-col :span="12">
            <el-form-item label="串号"> {{black.form.imei}} </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格"> {{black.form.specs}} </el-form-item>
          </el-col>
        </el-row>

        <el-form-item label="备注">
          <el-input v-model="black.form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>

      <div style="margin-top: 10px">
        <el-button plain type="primary" size="mini" @click="saveBlack">保存</el-button>
      </div>

      <div style="margin-top: 20px">
        <el-table  :data="black.list" border>
          <el-table-column type="index"  label="序号" align="center" />
          <el-table-column label="商品编码" align="center" prop="goodsId" />
          <el-table-column label="串号" align="center" prop="imei" />
          <el-table-column label="规格" align="center" prop="specs" />
          <el-table-column label="创建人名称" align="center" prop="createName" />
          <el-table-column label="备注" align="center" prop="remark" />
        </el-table>
      </div>
    </el-dialog>

    <!-- 添加或修改散户验机对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="95%" append-to-body style="max-height: 900px;">
      <div v-if="blackList.length > 0" style="color: red;font-weight: bold;font-size: 24px;padding-bottom: 10px;text-align: center">
        黑名单中有该串号！！！
      </div>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="8">
            <el-form-item class="item-sty" label="串号" prop="goodsSn">
              <el-input v-model="form.goodsSn" placeholder="请输入串号" @blur="changeImei()" />
            </el-form-item>
            <el-form-item class="item-sty" label="商品型号" prop="shareGoodsId">
              <el-select filterable remote placeholder="请输入商品关键字" @change="goodsChange"
                         v-model="form.shareGoodsId" :remote-method="getShareGoodsOptions">
                <el-option v-for="good in shareGoodsOptions"
                           :key="good.goodsId"
                           :label="good.goodsName"
                           :value="good.goodsId" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="item-sty" label="供应商" prop="supplierName">
              <el-select v-model="form.supplierName" placeholder="请选择供应商" filterable clearable>
                <el-option v-for="(item,key) in supplierList" :label="item.supplierName" :key="key" :value="item.supplierName" />
              </el-select>
            </el-form-item>

            <el-form-item label="成色" prop="fineness">
              <el-select v-model="form.fineness" placeholder="请选择成色">
                <el-option v-for="item in qualityList" :label="item.qualityName" :value="item.qualityName" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="item-sty" label="手机号" prop="mobile">
              <el-input v-model="form.mobile" placeholder="请输入手机号" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-form-item class="item-sty" v-for="specs in specsRadios" :label="specs.label" size="small">
          <el-radio-group v-model="specs.selected">
            <el-radio v-for="radio in specs.children"
                      :label="radio.value" border class="radio-sty">{{radio.text}}</el-radio>
          </el-radio-group>
        </el-form-item>
<!--        <el-form-item class="item-sty" v-for="test in testRadios" :label="test.label" size="small">
          <el-radio-group v-model="test.selected">
            <el-radio v-for="radio in test.children"
                      :label="radio.value" border class="radio-sty">{{radio.text}}</el-radio>
          </el-radio-group>
          <el-button size="small" type="danger" @click="test.selected = null" plain>清除</el-button>
        </el-form-item>-->

        <div class="topic-sty" v-for="type in topicTypeList">
          <div class="topic-title">{{type.label}}</div>
          <el-form-item class="item-sty" v-for="test in type.list" :label="test.label" size="small">
            <el-radio-group v-model="test.selected">
              <el-radio v-for="radio in test.children"
                        :label="radio.value" border class="radio-sty">{{radio.text}}</el-radio>
            </el-radio-group>
            <el-button size="small" type="danger" @click="test.selected = null" plain>清除</el-button>
          </el-form-item>
        </div>

        <el-form-item label="报价" prop="price">
          <el-input v-model="form.price" placeholder="请输入报价" />
        </el-form-item>

        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listScattered, getScattered, delScattered, addScattered, updateScattered, exportScattered, collectGoods } from "@/api/recovery/scattered";
import {getShareGoods, listShareGoods} from "@/api/share/goods";
import {listSpecs} from "@/api/share/specs";
import {listValues} from "@/api/share/values";
import {listTestTitle} from "@/api/basic/testTitle";
import {listTestValues} from "@/api/basic/testValues";
import {strTranArray} from "@/utils/tran/shareUtils";
import {listUser} from "@/api/system/user"
import {listSupplier} from "@/api/basic/supplier";
import {updateGoods} from "@/api/recovery/goods";
import {listQuality} from "@/api/share/quality";
import {listBlacklist, addBlacklist} from "@/api/recovery/blacklist";

export default {
  name: "Scattered",
  components: {
  },
  data() {
    return {
      black: {
        open: false,
        list: [],
        form: {}
      },
      //黑名单列表
      blackList: [],
      qualityList: [],
      topicTypeList: [],
      //验机分类
      topicTypeOptions: [],
      createTimeRange: [],
      //供应商
      supplierList: [],
      // 用户列表
      userList: [],
      // 验机内容列表
      testValuesList: [],
      //验机选项内容
      testRadios: [],
      // 规格标题
      specsList: [],
      // 规格选项组
      specsRadios: [],
      //共享模块的商品信息
      shareGoodsOptions: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 散户验机表格数据
      scatteredList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        shareGoodsId: null,
        specsIds: null,
        testValues: null,
        price: null,
        createId: null,
        status: null,
        goodsName: null,
        goodsSn: null,
        supplierName: null,
        params: {}
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        goodsSn: [
          { required: true, message: "串号不能为空", trigger: "blur" }
        ],
        shareGoodsId: [
          { required: true, message: "商品型号不能为空", trigger: "blur" }
        ],
        price: [
          { required: true, message: "商品价格不能为空", trigger: "blur" }
        ],
        fineness: [
          { required: true, message: "成色不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
    this.getSpecsAndValuesList();
    listTestValues({}).then(resp => {
      this.testValuesList = resp.rows;
    })
    listUser({}).then(resp => {
      this.userList = resp.rows;
    })
    listSupplier({}).then(resp => {
      this.supplierList = resp.rows;
    })
    listQuality({}).then(res => {
      this.qualityList = res.rows;
    })

    this.getDicts("basic_test_title_topic_type").then(response => {
      this.topicTypeOptions = response.data;
    });
  },
  methods: {
    resetBalck() {
      this.black.form = {
        imei: null,
        specs: null,
        remark: null,
      }
      this.black.list = [];
    },
    saveBlack() {
      if(!this.black.form.remark) {
        this.msgWarning("请输入备注");
        return
      }
      addBlacklist(this.black.form).then(res => {
        this.msgSuccess("操作成功！");
        listBlacklist({imei:this.black.form.imei}).then(res => {
          this.black.list = res.rows;
          this.black.form.remark = null;
        })
      })
    },
    handleBlack(row) {
      this.resetBalck();
      listBlacklist({imei:row.goodsSn}).then(res => {
        this.black.list = res.rows;
        this.black.open = true;
      })
      this.black.form.goodsId = "散户";
      this.black.form.imei = row.goodsSn;
      this.black.form.specs = row.printing;
    },
    changeImei() {
      this.blackList = [];
      listBlacklist({imei: this.form.goodsSn}).then(res => {
        this.blackList = res.rows;
      })
    },
    handleHasPay(row) {
      this.$confirm("确定已经标记编号：" + row.scatteredId + " 为已打款?", "警告", {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$set(row, "hasPay", 1);
        return updateGoods(row);
      }).then(res => {
        this.getList();
        this.msgSuccess("操作成功！");
      })
    },
    /** 创建时间选项*/
    createTimeChange(e) {
      if(e == null) {
        this.$delete(this.queryParams.params, 'createStartTime');
        this.$delete(this.queryParams.params, 'createEndTime');
        return
      }
      this.$set(this.queryParams.params, 'createStartTime', e[0]);
      this.$set(this.queryParams.params, 'createEndTime', e[1]);
    },
    /** 确认回收*/
    handleCollect(row) {
      this.$confirm("是否回收 编号为: " + row.scatteredId + "的数据？", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "关闭",
        type: "warning"
      }).then(function () {
        return collectGoods(row);
      }).then(resp => {
        this.msgSuccess("操作成功！")
        this.getList();
      })
    },
    /** 用户 */
    userFormatter(row, column, colValue) {
      for(let i = 0; i < this.userList.length; i++) {
        if(colValue === this.userList[i].userId) {
          return this.userList[i].nickName;
        }
      }
    },
    /** 验机报告转换*/
    testValuesFormatter(row) {
      if(row.testValues == null) {
        return "没有验机报告哦！";
      }
      let arr = strTranArray(row.testValues);
      let res ="";
      for(let i = 0; i < arr.length; i++) {
        for(let j = 0; j < this.testValuesList.length; j++) {
          if(arr[i] === this.testValuesList[j].valuesId) {
            res += "[" + this.testValuesList[j].valuesName + "]-";
            break;
          }
        }
      }
      return res.substring(0, res.length - 1);
    },
    /** 获取规格和验机报告选择结果*/
    getSpecsIdsAndTestValues() {
      let specsId = "";
      let printing = "";
      for(let i = 0; i < this.specsRadios.length; i++) {
        specsId += this.specsRadios[i].selected + ",";
        for(let j = 0; this.specsRadios[i].children.length; j++) {
          if(this.specsRadios[i].selected === this.specsRadios[i].children[j].value) {
            printing += this.specsRadios[i].children[j].text + " ";
            break;
          }
        }
      }
      this.form.specsIds = specsId.substring(0, specsId.length - 1);
      this.form.printing = printing.substring(0, printing.length - 1);

      let testValues = "";
      for(let i = 0; i < this.testRadios.length; i++) {
        if(this.testRadios[i].selected != null) {
          testValues += this.testRadios[i].selected + ",";
        }
      }
      this.form.testValues = testValues.substring(0, testValues.length - 1);
    },
    /** 初始化选项 */
    initSpecsAndTest() {
      if(this.form.specsIds != null) {
        let specsArr = strTranArray(this.form.specsIds);
        for(let i = 0; i < this.specsRadios.length; i++) {
          let res = this.getSelectRadioValue(specsArr, this.specsRadios[i].children);
          if(res != null) {
            this.specsRadios[i].selected = res;
          }
        }

        if(this.form.testValues != null) {
          let testArr = strTranArray(this.form.testValues);
          for(let i = 0; i < this.testRadios.length; i++) {
            let res = this.getSelectRadioValue(testArr, this.testRadios[i].children);
            if(res != null) {
              this.testRadios[i].selected = res;
            }
          }
        }
      }
    },

    getSelectRadioValue(arr, radios) {
      for(let i = 0; i < arr.length; i++) {
        for(let j = 0; j < radios.length; j++) {
          if(arr[i] === radios[j].value) {
            return arr[i];
          }
        }
      }
      return null;
    },
    /** 获取验机选项 */
    async getSpecsMapList(brandId, typeId) {
      let titleList = [];
      let valuesList = [];
      let params = {
        typeIds : typeId,
        isApple : parseInt(brandId) === 1 ? null : 1
      }
      await listTestTitle(params).then(resp => {
        titleList = resp.rows;
      })
      await listTestValues({}).then(resp => {
        valuesList = resp.rows;
      })

      this.testRadios = [];
      for(let i = 0; i < titleList.length; i++) {
        let data = {
          label: titleList[i].titleName,
          type: titleList[i].topicType,
          selected: null,
          children: []
        }
        for(let j = 0; j < valuesList.length; j++) {
          if(titleList[i].titleId === valuesList[j].titleId) {
            let children = {text: valuesList[j].valuesName, value: valuesList[j].valuesId}
            data.children.push(children);
          }
        }
        this.testRadios.push(data);
      }
      this.initSpecsAndTest(); //初始化商品数据
      this.getTopicType();
    },

    getTopicType() {
      let arr = [];
      this.topicTypeOptions.forEach(it => {
        let obj = {
          label: it.dictLabel,
          value: it.dictValue,
          list: []
        }
        arr.push(obj);
      })
      arr.push({
        label: '其它',
        value: null,
        list: []
      })

      arr.forEach(a => {
        this.testRadios.forEach((b,key) => {
          if(b.type === a.value) {
            a.list.push(b);
          }
        })
      })
      this.topicTypeList = arr;
    },
    /** 规格内容格式*/
    specsValuesFormatter(valuesId) {
      for(let i = 0; i < this.specsValuesList.length; i++) {
        if (valuesId === this.specsValuesList[i].valuesId) {
          return this.specsValuesList[i].valuesName;
        }
      }
    },
    /** 获取规格组 */
    getSpecsAndValuesList() {
      listSpecs({}).then(resp => {
        this.specsList = resp.rows;
      })
      listValues({}).then(resp => {
        this.specsValuesList = resp.rows;
      })
    },
    /** 规格标题格式 */
    specsTitleFormatter(specsId) {
      for (let i = 0; i < this.specsList.length; i++) {
        if(specsId === this.specsList[i].specsId) {
          return this.specsList[i].specsName;
        }
      }
    },
    /** 共享模块商品信息 */
    getShareGoodsOptions(e) {
      listShareGoods({goodsName: e}).then(resp => {
        this.shareGoodsOptions = resp.rows;
      })
    },
    /** 商品型号选着事件 */
    goodsChange(e) {
      getShareGoods(e).then(resp => {
        this.form.goodsName = resp.data.goodsName;
        let specsMap = JSON.parse(resp.data.specsMap);
        this.specsRadios = [];
        for(let i = 0; i < specsMap.length; i++) {
          let data = null;        //单选组
          let isNewTitle = true;  //是否新标题
          let j = 0;              //当前内容
          while (j < this.specsRadios.length) {
            if(this.specsRadios[j].key === specsMap[i][0]) {
              isNewTitle = false;
              break;
            }
            j++;
          }
          if(isNewTitle) {
            data = {
              label: this.specsTitleFormatter(specsMap[i][0]),
              key: specsMap[i][0],
              selected: specsMap[i][1],
              children: [{text: this.specsValuesFormatter(specsMap[i][1]),value: specsMap[i][1]}]
            }
            this.specsRadios.push(data);
          }else {
            this.specsRadios[j].children.push({text: this.specsValuesFormatter(specsMap[i][1]), value: specsMap[i][1]});
          }
        }
        this.getSpecsMapList(resp.data.brandId, resp.data.typeId);
      })
    },
    /** 查询散户验机列表 */
    getList() {
      this.loading = true;
      listScattered(this.queryParams).then(response => {
        this.scatteredList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        scatteredId: null,
        shareGoodsId: null,
        specsIds: null,
        testValues: null,
        price: null,
        createId: null,
        createTime: null,
        status: 0,
        remark: null,
        printing: null,
        supplierName: '散户',
        mobile: null,
        fineness: undefined
      };
      this.resetForm("form");
      this.testRadios = [];
      this.specsRadios = [];
      this.topicTypeList = [];
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeRange = [];
      this.createTimeChange(null);
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.scatteredId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加散户验机";
      this.blackList = [];
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const scatteredId = row.scatteredId || this.ids
      this.blackList = [];
      getScattered(scatteredId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改散户验机";
        if(this.form.shareGoodsId != null) {
          this.goodsChange(this.form.shareGoodsId);
          getShareGoods(this.form.shareGoodsId).then(resp => {
            this.shareGoodsOptions = [];
            this.shareGoodsOptions.push(resp.data);
          })
        }else {
          this.specsRadios = [];
          this.testRadios = [];
          this.topicTypeList = [];
        }
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.getSpecsIdsAndTestValues();
          if (this.form.scatteredId != null) {
            updateScattered(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addScattered(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const scatteredIds = row.scatteredId || this.ids;
      this.$confirm('是否确认删除散户验机编号为"' + scatteredIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delScattered(scatteredIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有散户验机数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportScattered(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>

<style>
.radio-sty {
  margin: 0 !important;
  margin-right: 10px !important;
}
.item-sty {
  margin: 1px !important;
}
.topic-sty {
  border-bottom: solid 1px #f3f4f6;
  padding: 20px;
  width: 90%;
  margin-left: 5%;
  margin-bottom: 10px;
}
.topic-title {
  color: #606266;
  font-size: 18px;
}
.table-row {
  white-space: nowrap;
  overflow: hidden;
}
</style>
